package lambda;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.List;

interface IMath2{
	public int add(int a, int b);
	public default int sub(int a,int b){
		return a-b;
	}
}

public class Test {
	public static void main(String[] args) {
		IMath2 im2 = (a,b)->a+b;
		System.out.println(im2.add(1, 2));
		
		Comparator<String> c = (o1,o2)->o1.compareTo(o2);
		System.out.println(c.compare("abc", "aaa"));
		
		List<String> list = Arrays.asList("abc","ddd","aaa");
		list.sort((s1,s2)->s2.compareTo(s1));
		System.out.println(list);
		
		list.sort(String::compareTo);
		System.out.println(list);
		
		list.forEach((t)->System.out.println(t));
	}
}
